home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / Tools / Development / renderlib40 / src / lib_init_68k.c < prev    next >
Encoding:
C/C++ Source or Header  |  2003-01-27  |  14.2 KB  |  692 lines

  1.  
  2. #include "lib_init.h"
  3. #include "lib_debug.h"
  4. #include <proto/exec.h>
  5.  
  6. #define AQuote(string) #string
  7. #define AVersion(major,minor) AQuote(major ## . ## minor)
  8. #define AmVersion(major,minor) AVersion(major,minor)
  9. #define LIBVER AmVersion(LIB_VERSION,LIB_REVISION)
  10. #define LIBTYPE " [68k, beta]"
  11.  
  12. #ifdef __SASC
  13.     #define LIBENT            __asm
  14.     #define REG(reg,arg)    register __ ## reg arg
  15. #endif
  16.  
  17. #ifdef __GNUC__
  18.     #define LIBENT
  19.     #define REG(reg,arg)    arg __asm( #reg )
  20. #endif
  21.  
  22. static LONG LibNull(void)
  23. {
  24.     return -1;
  25. }
  26.  
  27. static const char LibVersion[] = "$VER: " LIB_NAME " " LIBVER " " LIB_DATE LIBTYPE;
  28.  
  29. static const struct LibInitStruct
  30. {
  31.     ULONG LibSize;
  32.     const void *FuncTable;
  33.     void *DataTable;
  34.     void (*InitFunc)(void);
  35.  
  36. } LibInitStruct;
  37.  
  38. static const struct Resident RomTag =
  39. {
  40.     RTC_MATCHWORD,
  41.     (struct Resident *) &RomTag,
  42.     (APTR) (&RomTag + 1),
  43.     RTF_AUTOINIT,
  44.     LIB_VERSION,
  45.     NT_LIBRARY,
  46.     0,
  47.     LIB_NAME,
  48.     (char *) &LibVersion[6],
  49.     (APTR) &LibInitStruct
  50. };
  51.  
  52. struct ExecBase *SysBase = NULL;
  53.  
  54. /*****************************************************************************
  55. **
  56. **    lib function wrappers.
  57. */
  58.  
  59. static LIBENT APTR libCreateRMHandlerA(
  60.     REG(a1, struct TagItem *tags))
  61. {
  62.     return CreateRMHandlerA(tags);
  63. }
  64.  
  65. static LIBENT void libDeleteRMHandler(
  66.     REG(a0, APTR rmh))
  67. {
  68.     DeleteRMHandler(rmh);
  69. }
  70.  
  71. static LIBENT APTR libAllocRenderMem(
  72.     REG(a0, APTR rmh), 
  73.     REG(d0, ULONG size))
  74. {
  75.     return AllocRenderMem(rmh, size);
  76. }
  77.  
  78. static LIBENT void libFreeRenderMem(
  79.     REG(a0, APTR rmh), 
  80.     REG(a1, APTR mem), 
  81.     REG(d0, ULONG size))
  82. {
  83.     FreeRenderMem(rmh, mem, size);
  84. }
  85.  
  86. static LIBENT APTR libAllocRenderVec(
  87.     REG(a0, APTR rmh),
  88.     REG(d0, ULONG size))
  89. {
  90.     return AllocRenderVec(rmh, size);
  91. }
  92.  
  93. static LIBENT void libFreeRenderVec(
  94.     REG(a0, APTR mem))
  95. {
  96.     FreeRenderVec(mem);
  97. }
  98.  
  99. static LIBENT APTR libAllocRenderVecClear(
  100.     REG(a0, APTR rmh), 
  101.     REG(d0, ULONG size))
  102. {
  103.     return AllocRenderVecClear(rmh, size);
  104. }
  105.  
  106. static LIBENT void libTurboFillMem(
  107.     REG(a0, APTR mem), 
  108.     REG(d0, ULONG len),
  109.     REG(d1, ULONG val))
  110. {
  111.     TurboFillMem(mem, len, val);
  112. }
  113.  
  114. static LIBENT void libTurboCopyMem(
  115.     REG(a0, APTR src), 
  116.     REG(a1, APTR dst),
  117.     REG(d0, ULONG len))
  118. {
  119.     TurboCopyMem(src, dst, len);
  120. }
  121.  
  122. static LIBENT APTR libCreateHistogramA(
  123.     REG(a1, struct TagItem *tags))
  124. {
  125.     return CreateHistogramA(tags);
  126. }
  127.  
  128. static LIBENT void libDeleteHistogram(
  129.     REG(a0, APTR histo))
  130. {
  131.     DeleteHistogram(histo);
  132. }
  133.  
  134. static LIBENT ULONG libAddRGB(
  135.     REG(a0, APTR histo),
  136.     REG(d0, ULONG rgb),
  137.     REG(d1, ULONG count))
  138. {
  139.     return AddRGB(histo, rgb, count);
  140. }
  141.  
  142. static LIBENT ULONG libQueryHistogram(
  143.     REG(a0, APTR histo),
  144.     REG(d0, Tag tag))
  145. {
  146.     return QueryHistogram(histo, tag);
  147. }
  148.  
  149. static LIBENT ULONG libAddRGBImageA(
  150.     REG(a0, APTR histo),
  151.     REG(a1, ULONG *rgb),
  152.     REG(d0, UWORD width),
  153.     REG(d1, UWORD height),
  154.     REG(a2, struct TagItem *tags))
  155. {
  156.     return AddRGBImageA(histo, rgb, width, height, tags);
  157. }
  158.  
  159. static LIBENT RNDPAL *libCreatePaletteA(
  160.     REG(a1, struct TagItem *tags))
  161. {
  162.     return CreatePaletteA(tags);
  163. }
  164.  
  165. static LIBENT void libDeletePalette(
  166.     REG(a0, RNDPAL *palette))
  167. {
  168.     DeletePalette(palette);
  169. }
  170.  
  171. static LIBENT void libImportPaletteA(
  172.     REG(a0, RNDPAL *palette),
  173.     REG(a1, APTR coltab),
  174.     REG(d0, UWORD numcol),
  175.     REG(a2, struct TagItem *tags))
  176. {
  177.     ImportPaletteA(palette, coltab, numcol, tags);
  178. }
  179.  
  180. static LIBENT void libExportPaletteA(
  181.     REG(a0, RNDPAL *palette),
  182.     REG(a1, APTR coltab),
  183.     REG(a2, struct TagItem *tags))
  184. {
  185.     ExportPaletteA(palette, coltab, tags);
  186. }
  187.  
  188. static LIBENT void libFlushPalette(
  189.     REG(a0, RNDPAL *palette))
  190. {
  191.     FlushPalette(palette);
  192. }
  193.  
  194. static LIBENT ULONG libAddChunkyImageA(
  195.     REG(a0, RNDHISTO *histogram),
  196.     REG(a1, UBYTE *chunky),
  197.     REG(d0, UWORD width),
  198.     REG(d1, UWORD height),
  199.     REG(a2, RNDPAL *palette),
  200.     REG(a3, struct TagItem *tags))
  201. {
  202.     return AddChunkyImageA(histogram, chunky, width, height, palette, tags);
  203. }
  204.  
  205. static LIBENT ULONG libExtractPaletteA(
  206.     REG(a0, RNDHISTO *histogram),
  207.     REG(a1, RNDPAL *palette),
  208.     REG(d0, UWORD numcol),
  209.     REG(a2, struct TagItem *tags))
  210. {
  211.     return ExtractPaletteA(histogram, palette, numcol, tags);
  212. }
  213.  
  214. static LIBENT struct RNDHistoEntry **libCreateHistogramPointerArray(
  215.     REG(a0, RNDHISTO *histogram))
  216. {
  217.     return CreateHistogramPointerArray(histogram);
  218. }
  219.  
  220. static LIBENT ULONG libCountRGB(
  221.     REG(a0, RNDHISTO *histogram),
  222.     REG(d0, ULONG rgb))
  223. {
  224.     return CountRGB(histogram, rgb);
  225. }
  226.  
  227. static LIBENT LONG libBestPen(
  228.     REG(a0, RNDPAL *palette),
  229.     REG(d0, ULONG rgb))
  230. {
  231.     return BestPen(palette, rgb);
  232. }
  233.  
  234. static LIBENT RNDMAP *libCreateMapEngineA(
  235.     REG(a0, RNDPAL *palette),
  236.     REG(a1, struct TagItem *tags))
  237. {
  238.     return CreateMapEngineA(palette, tags);
  239. }
  240.  
  241. static LIBENT void libDeleteMapEngine(
  242.     REG(a0, RNDMAP *mapengine))
  243. {
  244.     DeleteMapEngine(mapengine);
  245. }
  246.  
  247. static LIBENT ULONG libMapRGBArrayA(
  248.     REG(a0, RNDMAP *engine),
  249.     REG(a1, ULONG *rgb),
  250.     REG(d0, UWORD width),
  251.     REG(d1, UWORD height),
  252.     REG(a2, UBYTE *chunky),
  253.     REG(a3, struct TagItem *tags))
  254. {
  255.     return MapRGBArrayA(engine, rgb, width, height, chunky, tags);
  256. }
  257.  
  258. static LIBENT ULONG libMapChunkyArrayA(
  259.     REG(a0, RNDMAP *engine),
  260.     REG(a1, UBYTE *src),
  261.     REG(a2, RNDPAL *palette),
  262.     REG(d0, UWORD width),
  263.     REG(d1, UWORD height),
  264.     REG(a3, UBYTE *dest),
  265.     REG(a4, struct TagItem *tags))
  266. {
  267.     return MapChunkyArrayA(engine, src, palette, width, height, dest, tags);
  268. }
  269.  
  270. static LIBENT ULONG libCountHistogram(
  271.     REG(a0, RNDHISTO *histo))
  272. {
  273.     return CountHistogram(histo);
  274. }
  275.  
  276. static LIBENT ULONG libAddHistogramA(
  277.     REG(a0, RNDHISTO *dst),
  278.     REG(a1, RNDHISTO *src),
  279.     REG(a2, struct TagItem *tags))
  280. {
  281.     return AddHistogramA(dst, src, tags);
  282. }
  283.  
  284. static LIBENT ULONG libChunky2RGBA(
  285.     REG(a0, UBYTE *src),
  286.     REG(d0, UWORD width),
  287.     REG(d1, UWORD height),
  288.     REG(a1, ULONG *dst),
  289.     REG(a2, RNDPAL *pal),
  290.     REG(a3, struct TagItem *tags))
  291. {
  292.     return Chunky2RGBA(src, width, height, dst, pal, tags);
  293. }
  294.  
  295. static LIBENT LONG libRGBArrayDiversityA(
  296.     REG(a0, ULONG *rgb),
  297.     REG(d0, UWORD width),
  298.     REG(d1, UWORD height),
  299.     REG(a1, struct TagItem *tags))
  300. {
  301.     return RGBArrayDiversityA(rgb, width, height, tags);
  302. }
  303.  
  304. static LIBENT LONG libChunkyArrayDiversityA(
  305.     REG(a0, UBYTE *chunky),
  306.     REG(a1, RNDPAL *palette),
  307.     REG(d0, UWORD width),
  308.     REG(d1, UWORD height),
  309.     REG(a2, struct TagItem *tags))
  310. {
  311.     return ChunkyArrayDiversityA(chunky, palette, width, height, tags);
  312. }
  313.  
  314. static LIBENT void libInsertAlphaChannelA(
  315.     REG(a0, UBYTE *chunky),
  316.     REG(d0, UWORD width),
  317.     REG(d1, UWORD height),
  318.     REG(a1, ULONG *rgb),
  319.     REG(a2, struct TagItem *tags))
  320. {
  321.     InsertAlphaChannelA(chunky, width, height, rgb, tags);
  322. }
  323.  
  324. static LIBENT void libExtractAlphaChannelA(
  325.     REG(a0, ULONG *rgb),
  326.     REG(d0, UWORD width),
  327.     REG(d1, UWORD height),
  328.     REG(a1, UBYTE *chunky),
  329.     REG(a2, struct TagItem *tags))
  330. {
  331.     ExtractAlphaChannelA(rgb, width, height, chunky, tags);
  332. }
  333.  
  334. static LIBENT void libApplyAlphaChannelA(
  335.     REG(a0, ULONG *src),
  336.     REG(d0, UWORD width),
  337.     REG(d1, UWORD height),
  338.     REG(a1, ULONG *dst),
  339.     REG(a2, struct TagItem *tags))
  340. {
  341.     ApplyAlphaChannelA(src, width, height, dst, tags);
  342. }
  343.  
  344. static LIBENT void libMixRGBArrayA(
  345.     REG(a0, ULONG *src),
  346.     REG(d0, UWORD width),
  347.     REG(d1, UWORD height),
  348.     REG(a1, ULONG *dst),
  349.     REG(d2, UWORD ratio),
  350.     REG(a2, struct TagItem *tags))
  351. {
  352.     MixRGBArrayA(src, width, height, dst, ratio, tags);
  353. }
  354.  
  355. static LIBENT void libCreateAlphaArrayA(
  356.     REG(a0, ULONG *rgb),
  357.     REG(d0, UWORD width),
  358.     REG(d1, UWORD height),
  359.     REG(a1, struct TagItem *tags))
  360. {
  361.     CreateAlphaArrayA(rgb, width, height, tags);
  362. }
  363.  
  364. static LIBENT void libMixAlphaChannelA(
  365.     REG(a0, ULONG *rgb1),
  366.     REG(a1, ULONG *rgb2),
  367.     REG(d0, UWORD width),
  368.     REG(d1, UWORD height),
  369.     REG(a2, ULONG *dest),
  370.     REG(a3, struct TagItem *tags))
  371. {
  372.     MixAlphaChannelA(rgb1, rgb2, width, height, dest, tags);
  373. }
  374.  
  375. static LIBENT void libTintRGBArrayA(
  376.     REG(a0, ULONG *src),
  377.     REG(d0, UWORD width),
  378.     REG(d1, UWORD height),
  379.     REG(d2, ULONG rgb),
  380.     REG(d3, UWORD ratio),
  381.     REG(a1, ULONG *dest),
  382.     REG(a2, struct TagItem *tags))
  383. {
  384.     TintRGBArrayA(src, width, height, rgb, ratio, dest, tags);
  385. }
  386.  
  387. static LIBENT ULONG libSortPaletteA(
  388.     REG(a0, RNDPAL *palette),
  389.     REG(d0, ULONG mode),
  390.     REG(a1, struct TagItem *tags))
  391. {
  392.     return SortPaletteA(palette, mode, tags);
  393. }
  394.  
  395. static LIBENT ULONG libRenderA(
  396.     REG(a0, ULONG *src),
  397.     REG(d0, UWORD width),
  398.     REG(d1, UWORD height),
  399.     REG(a1, UBYTE *dst),
  400.     REG(a2, RNDPAL *palette),
  401.     REG(a3, struct TagItem *tags))
  402. {
  403.     return RenderA(src, width, height, dst, palette, tags);
  404. }
  405.  
  406.  
  407. static LIBENT void libPlanar2ChunkyA(
  408.     REG(a0, UWORD **planetab),
  409.     REG(d0, UWORD bytewidth),
  410.     REG(d1, UWORD rows),
  411.     REG(d2, UWORD depth),
  412.     REG(d3, UWORD bytesperrow),
  413.     REG(a1, UBYTE *dst),
  414.     REG(a2, struct TagItem *tags))
  415. {
  416.     Planar2ChunkyA(planetab, bytewidth, rows, depth, bytesperrow, dst, tags);
  417. }
  418.  
  419. static LIBENT void libChunky2BitMapA(
  420.     REG(a0, UBYTE *src),
  421.     REG(d0, UWORD sx),
  422.     REG(d1, UWORD sy),
  423.     REG(d2, UWORD width),
  424.     REG(d3, UWORD height),
  425.     REG(a1, struct BitMap *bm),
  426.     REG(d4, UWORD dx),
  427.     REG(d5, UWORD dy),
  428.     REG(a2, struct TagItem *tags))
  429. {
  430.     Chunky2BitMapA(src, sx, sy, width, height, bm, dx, dy, tags);
  431. }
  432.  
  433. static LIBENT ULONG libGetPaletteAttrs(
  434.     REG(a0, RNDPAL *pal),
  435.     REG(d0, ULONG args))
  436. {
  437.     return GetPaletteAttrs(pal, args);
  438. }
  439.  
  440. static LIBENT void libRemapArrayA(
  441.     REG(a0, UBYTE *src),
  442.     REG(d0, UWORD width),
  443.     REG(d1, UWORD height),
  444.     REG(a1, UBYTE *dst),
  445.     REG(a2, UBYTE *pentab),
  446.     REG(a3, struct TagItem *tags))
  447. {
  448.     RemapArrayA(src, width, height, dst, pentab, tags);
  449. }
  450.  
  451. static LIBENT ULONG libConvertChunkyA(
  452.     REG(a0, UBYTE *src),
  453.     REG(a1, RNDPAL *srcpal),
  454.     REG(d0, UWORD width),
  455.     REG(d1, UWORD height),
  456.     REG(a2, UBYTE *dst),
  457.     REG(a3, RNDPAL *dstpal),
  458.     REG(a4, struct TagItem *tags))
  459. {
  460.     return ConvertChunkyA(src, srcpal, width, height, dst, dstpal, tags);
  461. }
  462.  
  463. static LIBENT void libCreatePenTableA(
  464.     REG(a0, UBYTE *src),
  465.     REG(a1, RNDPAL *srcpal),
  466.     REG(d0, UWORD width),
  467.     REG(d1, UWORD height),
  468.     REG(a2, RNDPAL *newpal),
  469.     REG(a3, UBYTE *pentab),
  470.     REG(a4, struct TagItem *tags))
  471. {
  472.     CreatePenTableA(src, srcpal, width, height, newpal, pentab, tags);
  473. }
  474.  
  475. static LIBENT RNDSCALE *libCreateScaleEngineA(
  476.     REG(d0, UWORD sw),
  477.     REG(d1, UWORD sh),
  478.     REG(d2, UWORD dw),
  479.     REG(d3, UWORD dh),
  480.     REG(a1, struct TagItem *tags))
  481. {
  482.     return CreateScaleEngineA(sw, sh, dw, dh, tags);
  483. }
  484.  
  485. static LIBENT void libDeleteScaleEngine(
  486.     REG(a0, RNDSCALE *sce))
  487. {
  488.     DeleteScaleEngine(sce);
  489. }
  490.  
  491. static LIBENT ULONG libScaleA(
  492.     REG(a0, RNDSCALE *sce),
  493.     REG(a1, APTR src),
  494.     REG(a2, APTR dst),
  495.     REG(a3, struct TagItem *tags))
  496. {
  497.     return ScaleA(sce, src, dst, tags);
  498. }
  499.  
  500. static LIBENT UWORD libScaleOrdinate(
  501.     REG(d0, UWORD start),
  502.     REG(d1, UWORD dest),
  503.     REG(d2, UWORD ordinate))
  504. {
  505.     return ScaleOrdinate(start, dest, ordinate);
  506. }
  507.  
  508.  
  509. /*****************************************************************************
  510. **
  511. **    lib setup
  512. */
  513.  
  514. #define SysBase LibBase->ExecBase
  515.  
  516. static LIBENT BPTR LibExpunge(
  517.     REG(a6, LIB_BASE_T *LibBase))
  518. {
  519.     if (LibBase->LibNode.lib_OpenCnt == 0 && LibBase->LibSegment)
  520.     {
  521.         BPTR TempSegment = LibBase->LibSegment;
  522.         Remove((struct Node *) LibBase);
  523.         FreeMem((APTR)((ULONG)(LibBase) - (ULONG)(LibBase->LibNode.lib_NegSize)),
  524.             LibBase->LibNode.lib_NegSize + LibBase->LibNode.lib_PosSize);
  525.         return TempSegment;
  526.     }
  527.     LibBase->LibNode.lib_Flags |= LIBF_DELEXP;
  528.     return NULL;
  529. }
  530.  
  531. static LIBENT LIB_BASE_T *LibOpen(
  532.     REG(a6, LIB_BASE_T *LibBase))
  533. {
  534.     LIB_BASE_T *result = LibBase;
  535.     ObtainSemaphore(&LibBase->LockSemaphore);
  536.     LibBase->LibNode.lib_Flags &= ~LIBF_DELEXP;
  537.     if (++LibBase->LibNode.lib_OpenCnt == 1)
  538.     {
  539.         if (!Library_Init(LibBase))
  540.         {
  541.             Library_Exit(LibBase);
  542.             LibBase->LibNode.lib_OpenCnt--;
  543.             result = NULL;
  544.         }
  545.     }
  546.     ReleaseSemaphore(&LibBase->LockSemaphore);
  547.     return result;
  548. }
  549.  
  550. static LIBENT BPTR LibClose(
  551.     REG(a6, LIB_BASE_T *LibBase))
  552. {
  553.     ObtainSemaphore(&LibBase->LockSemaphore);
  554.     if (LibBase->LibNode.lib_OpenCnt > 0)
  555.     {
  556.         if (--LibBase->LibNode.lib_OpenCnt == 0)
  557.         {
  558.             Library_Exit(LibBase);
  559.         }
  560.     }
  561.     ReleaseSemaphore(&LibBase->LockSemaphore);
  562.     if (LibBase->LibNode.lib_OpenCnt == 0 && (LibBase->LibNode.lib_Flags & LIBF_DELEXP))
  563.     {
  564.         return LibExpunge(LibBase);
  565.     }
  566.     return NULL;
  567. }
  568.  
  569. #undef SysBase
  570.  
  571. static LIBENT LIB_BASE_T *LibInit(
  572.     REG(d0, LIB_BASE_T *LibBase),
  573.     REG(a0, BPTR Segment),
  574.     REG(a6, struct ExecBase *ExecBase))
  575. {
  576.     SysBase = ExecBase;
  577.  
  578.     if (!(SysBase->AttnFlags & AFF_68020) ||
  579.         !(SysBase->AttnFlags & AFF_68020))
  580.     {
  581.         FreeMem((APTR)((ULONG)(LibBase) - (ULONG)(LibBase->LibNode.lib_NegSize)),
  582.             LibBase->LibNode.lib_NegSize + LibBase->LibNode.lib_PosSize);
  583.         return NULL;
  584.     }
  585.  
  586.     LibBase->LibNode.lib_Revision = LIB_REVISION;
  587.     LibBase->LibSegment = Segment;
  588.     LibBase->ExecBase = SysBase;
  589.     InitSemaphore(&LibBase->LockSemaphore);
  590.     return LibBase;
  591. }
  592.  
  593. static const ULONG LibVectors[] =
  594. {
  595.     (ULONG) LibOpen,
  596.     (ULONG) LibClose,
  597.     (ULONG) LibExpunge,
  598.     (ULONG) LibNull,
  599.  
  600. /*****************************************************************************
  601. **
  602. **    function table
  603. */
  604.  
  605.     (ULONG)    libTurboFillMem,
  606.     (ULONG)    libTurboCopyMem,
  607.     (ULONG) libCreateRMHandlerA,
  608.     (ULONG) libDeleteRMHandler,
  609.     (ULONG) libAllocRenderMem,
  610.     (ULONG) libFreeRenderMem,
  611.     (ULONG) libAllocRenderVec,
  612.     (ULONG) libFreeRenderVec,
  613.     (ULONG) libCreateHistogramA,
  614.     (ULONG) libDeleteHistogram,
  615.     (ULONG) libQueryHistogram,
  616.     (ULONG) libAddRGB,
  617.     (ULONG) libAddRGBImageA,
  618.     (ULONG) libAddChunkyImageA,
  619.     (ULONG) libExtractPaletteA,
  620.     (ULONG) libRenderA,
  621.     (ULONG) libPlanar2ChunkyA,
  622.     (ULONG) libChunky2RGBA,
  623.     (ULONG) libChunky2BitMapA,
  624.     (ULONG) libCreateScaleEngineA,
  625.     (ULONG) libDeleteScaleEngine,
  626.     (ULONG) libScaleA,
  627.     (ULONG) libConvertChunkyA,
  628.     (ULONG) libCreatePenTableA,
  629.     (ULONG) libCreatePaletteA,
  630.     (ULONG) libDeletePalette,
  631.     (ULONG) libImportPaletteA,
  632.     (ULONG) libExportPaletteA,
  633.     (ULONG) libCountRGB,
  634.     (ULONG) libBestPen,
  635.     (ULONG) libFlushPalette,
  636.     (ULONG) libSortPaletteA,
  637.     (ULONG) libAddHistogramA,
  638.     (ULONG) libScaleOrdinate,
  639.     (ULONG) libCreateHistogramPointerArray,
  640.     (ULONG) libCountHistogram,
  641.     (ULONG) libCreateMapEngineA,
  642.     (ULONG) libDeleteMapEngine,
  643.     (ULONG) libMapRGBArrayA,
  644.     (ULONG) libRGBArrayDiversityA,
  645.     (ULONG) libChunkyArrayDiversityA,
  646.     (ULONG) libMapChunkyArrayA,
  647.     (ULONG) libInsertAlphaChannelA,
  648.     (ULONG) libExtractAlphaChannelA,
  649.     (ULONG) libApplyAlphaChannelA,
  650.     (ULONG) libMixRGBArrayA,
  651.     (ULONG) libAllocRenderVecClear,
  652.     (ULONG) libCreateAlphaArrayA,
  653.     (ULONG) libMixAlphaChannelA,
  654.     (ULONG) libTintRGBArrayA,
  655.     (ULONG)    libGetPaletteAttrs,
  656.     (ULONG) libRemapArrayA,
  657.     0xFFFFFFFF
  658. };
  659.  
  660.  
  661. static const struct LibInitStruct LibInitStruct =
  662. {
  663.     sizeof(LIB_BASE_T),
  664.     LibVectors,
  665.     NULL,
  666.     (void (*)(void)) &LibInit
  667. };
  668.  
  669.  
  670. #ifdef __SASC
  671.  
  672. /* 
  673. **    create a dummy reference to the static const data, so that
  674. **    it doesn't get optimized away by the compiler :)
  675. */
  676.  
  677. APTR foo = &RomTag;
  678.  
  679. #include <math.h>
  680. #if !defined(_FFP)
  681. void __stdargs _CXFERR(int code) {}
  682. #endif
  683. double __except(int a,const char *b,double c,double e,double f) { return f; }
  684.  
  685. #endif
  686.  
  687. #if defined(__GNUC__) && defined(__HAVE_68881__)
  688.  
  689. int errno;
  690.  
  691. #endif
  692.